[CMIS] Catch Exception to avoid CMIS code crash#299
Merged
prgeor merged 2 commits intosonic-net:masterfrom Aug 20, 2022
Merged
Conversation
Signed-off-by: Kebo Liu <[email protected]>
stephenxs
previously approved these changes
Aug 12, 2022
Collaborator
|
@prgeor this is critical fix for 202205. can you please approve? |
Collaborator
|
@keboliu could you paste the exception backtrace in the description? |
prgeor
reviewed
Aug 17, 2022
| bulk_status['laser_temperature'] = laser_temp_dict['monitor value'] | ||
| self.vdm_dict = self.get_vdm() | ||
| try: | ||
| bulk_status['laser_temperature'] = laser_temp_dict['monitor value'] |
Collaborator
There was a problem hiding this comment.
Collaborator
Author
There was a problem hiding this comment.
not sure I understand, I moved bulk_status['laser_temperature'] = laser_temp_dict['monitor value'] to try section to avoid the case that laser_temp_dict is none
| raise ValueError('Page not in VDM Descriptor range!') | ||
| vdm_descriptor = self.xcvr_eeprom.read_raw(page * PAGE_SIZE + PAGE_OFFSET, PAGE_SIZE) | ||
|
|
||
| if not vdm_descriptor: |
Collaborator
There was a problem hiding this comment.
There are other eeprom read in this function. can you take care of them also?
Signed-off-by: Kebo Liu <[email protected]>
prgeor
approved these changes
Aug 20, 2022
yxieca
pushed a commit
that referenced
this pull request
Aug 26, 2022
* catch Exception to avoid CMIS code crash Signed-off-by: Kebo Liu <[email protected]> * fix review comments, add more UT test Signed-off-by: Kebo Liu <[email protected]> Signed-off-by: Kebo Liu <[email protected]>
dprital
added a commit
to dprital/sonic-buildimage
that referenced
this pull request
Aug 29, 2022
Update sonic-platform-common submodule pointer to include the following: * [CMIS] Catch Exception to avoid CMIS code crash ([sonic-net#299](sonic-net/sonic-platform-common#299)) * [Credo][Ycable] fix incorrect uart statistics ([sonic-net#296](sonic-net/sonic-platform-common#296)) * Add PSU input voltage and input current ([sonic-net#295](sonic-net/sonic-platform-common#295)) Signed-off-by: dprital <[email protected]>
7 tasks
dprital
added a commit
to dprital/sonic-buildimage
that referenced
this pull request
Sep 4, 2022
Update sonic-platform-common submodule pointer to include the following: * [CMIS] 'get_transceiver_info' should return 'None' when CMIS cable EEPROM is not ready ([sonic-net#305](sonic-net/sonic-platform-common#305)) * uplift code coverage 80% ([sonic-net#307](sonic-net/sonic-platform-common#307)) * [sonic-pcie] Add UT for pcie_common.py ([sonic-net#293](sonic-net/sonic-platform-common#293)) * [CMIS] Catch Exception to avoid CMIS code crash ([sonic-net#299](sonic-net/sonic-platform-common#299)) * [Credo][Ycable] fix incorrect uart statistics ([sonic-net#296](sonic-net/sonic-platform-common#296)) * Add PSU input voltage and input current ([sonic-net#295](sonic-net/sonic-platform-common#295)) Signed-off-by: dprital <[email protected]>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Kebo Liu [email protected]
Description
To protect the code from crashing by catching the exception
Motivation and Context
This is to fix the issue sonic-net/sonic-buildimage#11525
How Has This Been Tested?
run sonic-mgmt sfp reset test case: platform_tests/sfp/test_sfputil.py::test_check_sfputil_reset to make sure xcvrd will not crash
Additional Information (Optional)